package com.jake.rabbit.demo.controller;

import com.jake.rabbit.demo.producer.TopicProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("topic")
public class TopicController {

    @Autowired
    private TopicProducer topicProducer;

    @RequestMapping("accurate")
    public void accurate(String msg) {
        topicProducer.sendAccurate(msg);
    }

    @RequestMapping("single")
    public void single(String msg) {
        topicProducer.sendSingle(msg);
    }

    @RequestMapping("any")
    public void any(String msg) {
        topicProducer.sendAny(msg);
    }

}
